<template>
  <div class="RefComponent">
    <!-- RefComponent组件 -->
    <div ref="title">title标题</div>
    <button @click="clickHandler">点击获取元素</button>
    <ref-component ref="refcom"></ref-component>
  </div>
</template>
<script>
import RefComponent from './RefComChild.vue'
export default {
  data () {
    return {
      name: 'zs'
    }
  },
  components: {
    RefComponent
  },
  methods: {
    clickHandler () {
      console.log('获取元素。。。', this.$refs.title)
      console.log('获取子组件的数据。。。。', this.$refs.refcom.message)
      this.$refs.refcom.messageA()
    }
  }
}
</script>
<style scoped>
</style>
